<?php
Yii::import('zii.widgets.CListView');
class MListView extends CListView
{
	public $table_header;
	public $table_footer;
	public function renderItems()
	{
//		echo '<table width="100%" cellspacing="0" cellpadding="0" border="0"><tbody>';
//		echo '<tr class="bg_table">
//			    <td width="71%" class="boder_right"><strong>Phone number</strong></td>
//			    <td align="center" width="29%"><strong>Action</strong></td>
//			  </tr>';
		echo $this->table_header;
		
		$data=$this->dataProvider->getData();
		if(($n=count($data)) > 0)
		{
			$owner=$this->getOwner();
			$render=$owner instanceof CController ? 'renderPartial' : 'render';
			$j=0;
			foreach($data as $i=>$item)
			{
				$data=$this->viewData;
				$data['index']=$i;
				$data['data']=$item;
				$data['widget']=$this;
				$owner->$render($this->itemView,$data);
				if($j++ < $n-1)
					echo $this->separator;
			}
		}
		else
			$this->renderEmptyText();
		//echo '</tbody></table>';
		echo $this->table_footer;
		
	}
	
	
}